import Vue from 'vue'
import Router from 'vue-router'

import _import from '@/router/_import'
import Layout from '@/views/layout/Layout'


Vue.use(Router)

export const RouterMaps = [
    { path: '/404', component: _import('error/Error-404'), hidden: true },
    { path: '/login', component: _import('login/index'), hidden: true },

    {
        path: '/',
        component: Layout,
        redirect: '/dashboard',
        name: '首页',
        hidden: true
    },
    {
        path: '/dashboard',
        component: Layout,
        noDropdown: true,
        children: [
            {path: '', component: _import('dashboard/default/index'), name: '控制台'}
        ]
    },
    {
        path: '/ucenter',
        name: '用户中心',
        component: Layout,
        redirect: 'noredirect',
        children: [
            {path: 'register', component: _import('dashboard/default/index'), name: '注册用户'},
            {path: 'thirdParty', component: _import('dashboard/default/index'), name: '第三方用户'}
        ]
    },
    {
        path: '/upms',
        name: '授权中心',
        component: Layout,
        redirect: 'noredirect',
        children: [
            {path: 'app', component:  _import('upms/app'), name: '应用管理'},
            {path: 'menu', component:  _import('upms/menu'), name: '菜单管理'},
            {path: 'organization', component:  _import('upms/organization'), name: '组织管理'},
            {path: 'user', component: _import('upms/user'), name: '用户管理'},
            {path: 'role', component: _import('upms/role'), name: '角色管理'},
            {path: 'permission', component: _import('upms/permission'), name: '权限管理'},
            {path: 'group', component: _import('upms/group'), name: '用户组管理'}
        ]
    },
    {
        path: '/system',
        name: '系统管理',
        component: Layout,
        redirect: 'noredirect',
        children: [
            {path: 'session', component: _import('system/session'), name: '会话管理'},
            {
                path: 'log',
                component: _import('system/log'),
                name: '日志管理',
                redirect: '/system/log/login',
                noDropdown: true,
                children: [
                    {path: 'login', component: _import('system/log/login'), name: '登陆日志'},
                    {path: 'operate', component: _import('system/log/operate'), name: '操作日志'},
                    {path: 'error', component: _import('system/log/error'), name: '错误日志'}
                ]
            }

        ]
    },

    {path: '*', redirect: '/404', hidden: true}
]

export default new Router({
    routes: RouterMaps
})

